package com.kunzai.threadrun2.numbertwo;

public class parkNumber implements Runnable{

    Integer parknumber = 100;

//    Object OBJECT = new Object();

    @Override
    public  void run() {

        while (true){
            synchronized (this) {
//                try {
////                    Thread.sleep(100);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
                if (parknumber<=0){
                    break;
                }
                System.out.println(Thread.currentThread() + "---------" +
                        parknumber--);

            }

        }


    }
}
